<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFilialesTable extends Migration
{
	public function up()
	{
		Schema::create('filiales', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('company_id')->unsigned()->index()->comment('商家ID');
            $table->string('name')->index()->comment('商家分店名');
            $table->string('phone')->index()->comment('电话');
            $table->string('address')->nullable()->comment('地址');
            $table->float('longitude', 10, 6)->nullable()->comment('经度');
            $table->float('latitude', 10, 6)->nullable()->comment('纬度');
            $table->boolean('forbidden')->default(false)->comment('禁用标志');
            $table->boolean('delflag')->default(false)->comment('删除标志');
            $table->timestamps();
        });
	}

	public function down()
	{
		Schema::drop('filiales');
	}
}
